package org.ecype.diego;

import java.lang.annotation.Annotation;
import java.lang.reflect.Field;

public class UriAction<T extends Annotation> {

	private Class<T> annotationClass;

	protected UriAction(Class<T> annotationClass) {
		this.annotationClass = annotationClass;
	}
	
	private String action;

	public void setup(Field description) throws IllegalAccessException {
		action = (String) description.get(null);
		setup(description.getAnnotation(annotationClass));
	}
	
	protected void setup(T annotation) {
	}

	public String getAction() {
		return action;
	}

}
